package com.cci.kangdao.escalation.dao;

import com.cci.kangdao.dao.model.UserT;
import com.cci.kangdao.escalation.dto.request.GetEscalationOrderListRequest;
import com.cci.kangdao.escalation.model.EscalationExpertVisibilityRangeT;
import com.cci.kangdao.escalation.model.EscalationOrderT;
import com.cci.kangdao.escalation.model.EscalationReasonT;
import com.cci.kangdao.escalation.model.TimeDiffAndType;
import com.cci.kangdao.model.WorkOrderInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface EscalationOrderTDao {
    int deleteByPrimaryKey(Long id);

    Long insert(EscalationOrderT record);

    Long insertSelective(EscalationOrderT record);

    EscalationOrderT selectByPrimaryKey(Long id);

    EscalationOrderT selectByWorkOrderId(Long workOrderId);

    int updateByPrimaryKeySelective(EscalationOrderT record);

    int updateByPrimaryKey(EscalationOrderT record);

    TimeDiffAndType selectTimeDiffAndType(@Param("id") Long id,@Param("currentTime") String currentTime);

    List<EscalationOrderT> getTechnicianOrderList(GetEscalationOrderListRequest request);

    List<EscalationOrderT> getStationMasterOrderList(GetEscalationOrderListRequest request);

    List<EscalationOrderT> getFieldEngineerOrderList(GetEscalationOrderListRequest request);

    List<EscalationOrderT> getInfoManagerOrderList(GetEscalationOrderListRequest request);

    List<EscalationOrderT> getExpertOrderList(GetEscalationOrderListRequest request);

    List<Map<String,Object>> getOrderListByNotify(@Param("receiverId") Long receiverId, @Param("category") String category);

    EscalationOrderT selectByOrderNo(String orderNo);

    List<EscalationReasonT> getModifyAuth(@Param("orderId") Long orderId, @Param("userId") long userId);

    List<EscalationOrderT> getAllExpertOrderList(GetEscalationOrderListRequest request);

    EscalationExpertVisibilityRangeT getIsShowAllOrder(String phone);

    List<WorkOrderInfo> getEscalationByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

    //查询服务专家仅能查看自己的工单
    UserT getExpertsByWorkOrderId(@Param("orderId") Long orderId,@Param("reasonKey") Integer reasonKey);

    //查询服务专家全部
    UserT getExpertsByAll();
}